package com.example.libo.huihui.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

/**
 * Created by lenovo on 2016/12/2.
 */

public class FragmentAdapter extends FragmentPagerAdapter {
    private String[] titles;
    private Fragment[] fragmentarrs;


    public FragmentAdapter(FragmentManager fragmentManager, String[] titles, Fragment[] findFgtArr) {
        super(fragmentManager);
        this.titles=titles;
        this.fragmentarrs=findFgtArr;
    }

    @Override
    public Fragment getItem(int position) {
        return fragmentarrs[position];
    }

    @Override
    public int getCount() {
        return fragmentarrs.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];

    }
}
